package com.tengju.data.domain.model.user;


import com.tengju.data.domain.model.clickhouse.DwsUserDominationTeamParent;
import com.tengju.data.domain.model.clickhouse.star.*;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

public interface DominationDetailRepository {

    DominationDetail getByIdCode(UserIdCode idCode);

    Integer customCount(List<UserIdCode> idCodes, List<StarLevelEnum> starLevel, DominationLevelEnum dominationLevel, UserIdCode leaderId, IsDirect isDirect);

    List<UserIdCode> getIdCodeCustom(List<UserIdCode> idCodes, List<StarLevelEnum> starLevel, DominationLevelEnum dominationLevel, UserIdCode leaderId, IsDirect isDirect);


    List<DominationDetail> customList(List<UserIdCode> idCodes, List<StarLevelEnum> starLevel, DominationLevelEnum dominationLevel, UserIdCode leaderId, IsDirect isDirect, DominationMemberSortType sortType, Integer offset, Integer limit);

    DominationMemberNew countNewMemberCurrentMonth(UserIdCode dominationIdCode, DominationLevelEnum dominationLevel,List<StarLevelEnum> starLevelList, LocalDateTime from , LocalDateTime to);

    DominationMemberNew countNewMemberCurrentMonthByIdCodes(List<UserIdCode> dominationIdCodes, DominationLevelEnum dominationLevel,LocalDateTime from , LocalDateTime to);

    List<DominationIdCodeMemberNew> countNewMemberCurrentMonthByDominationIdCodes(List<UserIdCode> dominationIdCodes, DominationLevelEnum dominationLevel, List<String> visitDates, Date fromDate, Date toDate);

    List<UpgradingDetail> queryNewMemberCurrentMonth(UserIdCode dominationIdCode, DominationLevelEnum dominationLevel,List<StarLevelEnum> starLevelList, LocalDateTime from , LocalDateTime to,int offset,int limit);

    /**
     * 计算管辖团队内即将晋升数
     */
    DominationUpComing countUpComingMemberByIdCodes(List<UserIdCode> idCodes, DominationLevelEnum dominationLevel);

    /**
     * 根据当前等级筛选  计算管辖团队内即将晋升数
     */
    DominationUpComing countUpComingMemberByCurrentStarLevel(UserIdCode idCode, DominationLevelEnum dominationLevel,List<StarLevelEnum> starLevelList);

    /**
     * 根据当前等级筛选  查询管辖团队内即将晋升明细
     */
    List<StarChangeNoticeRecord> queryUpComingMemberByCurrentStarLevel(UserIdCode idCode, DominationLevelEnum dominationLevel, List<StarLevelEnum> starLevelList, int offset, int limit);

    /**
     * 根据当前等级及即将晋升等级筛选   计算管辖团队内即将晋升数
     */
    DominationUpComing countUpComingMemberByUpComingStarLevel(UserIdCode idCode, DominationLevelEnum dominationLevel,List<StarLevelEnum> targetStarLevelList, List<StarLevelEnum> currentStarLevelList);

    /**
     * 根据当前等级及即将晋升等级筛选   查询管辖团队内即将晋升明细
     */
    List<StarChangeNoticeRecord>  queryUpComingMemberByUpComingStarLevel(UserIdCode idCode, DominationLevelEnum dominationLevel, List<StarLevelEnum> targetStarLevelList, List<StarLevelEnum> currentStarLevelList, int offset, int limit);

    /**
     * 计算管辖团队内签约中数
     */
    DominationSigningMember countSigningMemberByIdCodesDominationLevel(List<UserIdCode> idCodes,DominationLevelEnum dominationLevel);

    boolean isDominationMember(UserIdCode idCode,UserIdCode dominationIdCode,DominationLevelEnum dominationLevel);

    List<DwsUserDominationTeamParent> getUserDominationTeamParent();

    List<DwsUserDominationTeamParent> getEecDominationTeamParent();

    List<DwsUserDominationTeamParent> getUserDominationTeamParentByDominationIdCodeList(List<UserIdCode> dominationIdCodeList);

    List<DwsUserDominationTeamParent> getEecDominationTeamParentByDominationIdCodeList(List<UserIdCode> dominationIdCodeList);

    List<DwsUserDominationTeamParent> getUserDominationTeamParentByDominationIdCode(UserIdCode dominationIdCode);

}
